<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>&lt;GMappedFile&gt;: </title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.2">
<link rel="home" href="index.html" title="">
<link rel="up" href="ch01.html" title="GLib">
<link rel="prev" href="re34.html" title="&lt;GMainLoop&gt;">
<link rel="next" href="re36.html" title="&lt;%GLibMarkupCollectType&gt;">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="re34.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="re36.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="id-1.1.36"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>&lt;GMappedFile&gt;</h2>
<p>&lt;GMappedFile&gt;</p>
</div>
<div class="refsect1">
<a name="id-1.1.36.2"></a><h2>Description</h2>
<p>The <span class="type">GMappedFile</span> represents a file mapping created with
<code class="function">g_mapped_file_new()</code>. It has only private members and should
not be accessed directly.</p>
</div>
<div class="refsect1">
<a name="id-1.1.36.3"></a><h2>Functions</h2>
<div class="refsect2">
<a name="id-1.1.36.3.2"></a><h3>free</h3>
<div class="informalexample"><pre class="programlisting">(define-values () (mapped-file:free self))
</pre></div>
<p>This call existed before <span class="type">GMappedFile</span> had refcounting and is currently
exactly the same as <code class="function">g_mapped_file_unref()</code>.</p>
<div class="refsect3">
<a name="id-1.1.36.3.2.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description">
<p>a <span class="type">GMappedFile</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.36.3.3"></a><h3>get-bytes</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (mapped-file:get-bytes self))
</pre></div>
<p>Creates a new <span class="type">GBytes</span> which references the data mapped from <em class="parameter"><code>file</code></em>.
The mapped contents of the file must not be modified after creating this
bytes object, because a <span class="type">GBytes</span> should be immutable.</p>
<div class="refsect3">
<a name="id-1.1.36.3.3.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description">
<p>a <span class="type">GMappedFile</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.36.3.4"></a><h3>get-contents</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (mapped-file:get-contents self))
</pre></div>
<p>Returns the contents of a <span class="type">GMappedFile</span>.
</p>
<p>Note that the contents may not be zero-terminated,
even if the <span class="type">GMappedFile</span> is backed by a text file.
</p>
<p>If the file is empty then <code class="constant">NULL</code> is returned.</p>
<div class="refsect3">
<a name="id-1.1.36.3.4.6"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description">
<p>a <span class="type">GMappedFile</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.36.3.5"></a><h3>get-length</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (mapped-file:get-length self))
</pre></div>
<p>Returns the length of the contents of a <span class="type">GMappedFile</span>.</p>
<div class="refsect3">
<a name="id-1.1.36.3.5.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description">
<p>a <span class="type">GMappedFile</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.36.3.6"></a><h3>ref</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (mapped-file:ref self))
</pre></div>
<p>Increments the reference count of <em class="parameter"><code>file</code></em> by one.  It is safe to call
this function from any thread.</p>
<div class="refsect3">
<a name="id-1.1.36.3.6.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description">
<p>a <span class="type">GMappedFile</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.36.3.7"></a><h3>unref</h3>
<div class="informalexample"><pre class="programlisting">(define-values () (mapped-file:unref self))
</pre></div>
<p>Decrements the reference count of <em class="parameter"><code>file</code></em> by one.  If the reference count
drops to 0, unmaps the buffer of <em class="parameter"><code>file</code></em> and frees it.
</p>
<p>It is safe to call this function from any thread.
</p>
<p>Since 2.22</p>
<div class="refsect3">
<a name="id-1.1.36.3.7.6"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description">
<p>a <span class="type">GMappedFile</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.36.3.8"></a><h3>mapped-file:new-from-fd</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (mapped-file:new-from-fd fd writable))
</pre></div>
<p>Undocumented</p>
<div class="refsect3">
<a name="id-1.1.36.3.8.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>fd</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">fd</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>writable</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">writable</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.36.3.9"></a><h3>mapped-file:new</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (mapped-file:new filename writable))
</pre></div>
<p>Undocumented</p>
<div class="refsect3">
<a name="id-1.1.36.3.9.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>filename</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">filename</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>writable</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">writable</code></p>
</td>
</tr>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>
